package cn.taokuaidi.wangwang.client.dataProxy;

import cn.taokuaidi.wangwang.client.data.Request;

import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.HttpProxy;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class OrderDataProxy extends HttpProxy {

    public OrderDataProxy(RequestBuilder builder) {
        super(builder);
    }

    public void setBuilder(RequestBuilder builder) {
        this.builder = builder;
        this.initUrl = builder.getUrl();
    }

    @Override
    public void load(DataReader reader, Object loadConfig, AsyncCallback callback) {
        PagingLoadConfig config = (PagingLoadConfig) loadConfig;
        if (config != null) {
            this.setBuilder(Request.getSellerBuilder());
        }
        super.load(reader, loadConfig, callback);
    }

}
